package recharge_management

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/rpc-client/assetsClient/rpc"

	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type WavepayDeleteLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// wavepay--删除
func NewWavepayDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WavepayDeleteLogic {
	return &WavepayDeleteLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *WavepayDeleteLogic) WavepayDelete(req *types.WavepayDeleteRequest) (resp *types.WavepayDeleteResponse, err error) {
	rpcReq := rpc.WavepayDeleteRequest{
		Id: req.Id,
	}

	rpcResp, err := l.svcCtx.AssetsRpc.TenantChannel.WavepayDelete(l.ctx, &rpcReq)
	if err != nil {
		return nil, err
	}

	return &types.WavepayDeleteResponse{
		CommonResp: types.CommonResp{
			Code:    rpcResp.CommonResp.Code,
			Message: rpcResp.CommonResp.Message,
		},
	}, nil
}
